home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C++ / Code Resources / 3D Buttons CDEF 1.0b4 / Source / 3D Buttons CDEF source / (3D Buttons CDEF.π) / LGBIconButton.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-04  |  1.6 KB  |  51 lines  |  [TEXT/MMCC]

  1. /**************************************************************************
  2.     LGBIconButton
  3.     
  4.     Public domain, by Zig Zichterman.
  5.     
  6.     This class implements 3D icon push buttons according to the guidelines
  7.     suggested in _develop_ 15. Some of the drawing code is taken from
  8.     the public domain source accompanying _develop_ 15.
  9.  
  10.     A new button variant that draws an icon button.  The icon draws
  11.     in a rectangular frame with 3D effects.
  12.     
  13.     LGBIconButton uses contrlValue for the resource id of the icon family.
  14.     You must set contrlValue (and probably contrlMax).
  15.     
  16.     LGBIconButton does not draw a title. Ever. Since it is bad HI to
  17.     display an icon without an accompanying text, you should place a 
  18.     caption near this button to clue the user in to just what your
  19.     icon means.
  20. **************************************************************************/
  21. #pragma once
  22.  
  23. class LGBIconButton {
  24.     public :
  25.         static long    Main(short inVariation, ControlHandle ioControl,
  26.                 short inMsg, long ioParam);
  27.  
  28.     // ———— contstructor —————————————————————————————————————————————
  29.     protected :
  30.         LGBIconButton(ControlRecord *inControl);
  31.         ControlRecord    *mControl;
  32.         
  33.     // ———— dispatch —————————————————————————————————————————————————
  34.     protected :
  35.         void    Draw(long inPartCode);
  36.         Boolean    Test(Point inHitPt);
  37.         void    CalcCRgn(RgnHandle ioRgn);
  38.         
  39.     // ———— Draw —————————————————————————————————————————————————————
  40.     protected :
  41.         void    DrawBW(void);
  42.         void    DrawBW3D(void);
  43.         void    DrawColor(void);
  44.         void    DrawColorInactive(void);
  45.         void    DrawColorActive(void);
  46.         void    DrawFrame(void);
  47.         void    EraseInsides(void);
  48.         void    DrawIcon(Boolean inColor = true);
  49.         void    Draw3DEffects(void);
  50. };
  51.